<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改预警规则管理信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-rule-edit" th:object="${alarmRule}">
            <input name="ruleId" th:field="*{ruleId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否全部卡口：</label>
                <div class="col-sm-8">
                    <select name="isQbkk" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isQbkk}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否替换原有规则：</label>
                <div class="col-sm-8">
                    <select name="isThgz" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isThgz}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">预警通行次数：</label>
                <div class="col-sm-8">
                    <input name="txcs" th:field="*{txcs}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">设定时间间隔(分钟)：</label>
                <div class="col-sm-8">
                    <input name="sjjg" th:field="*{sjjg}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">行政区域：</label>
                <div class="col-sm-8">
                    <select name="xzqh" class="form-control m-b" th:with="type=${@dict.getType('xzqhxzqh')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{xzqh}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">卡口类型：</label>
                <div class="col-sm-8">
                    <select name="kklx" class="form-control m-b" th:with="type=${@dict.getType('bayonet_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{kklx}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">卡口编号：</label>
                <div class="col-sm-8">
                    <select name="kkbh" class="form-control m-b" th:with="type=${@dict.selectBayonetList()}" required>
                        <option th:each="dict : ${type}" th:text="${dict.bayonetName}" th:value="${dict.bayonetNum}" th:field="*{kkbh}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "rule/rule";
        $("#form-rule-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-rule-edit').serialize());
            }
        }
    </script>
</body>
</html>